package com.samebuilding.service.impl;

import java.util.List;

import com.samebuilding.dao.DiaryDAO;
import com.samebuilding.domain.Diary;
import com.samebuilding.service.DiaryService;

public class DiaryServiceImpl implements DiaryService {
	
	private DiaryDAO diaryDAO;
	
	public DiaryDAO getDiaryDAO() {
		return diaryDAO;
	}

	public void setDiaryDAO(DiaryDAO diaryDAO) {
		this.diaryDAO = diaryDAO;
	}

	public void deleteDiary(Diary d) {
		diaryDAO.deleteDiary(d);
	}

	public void editDiary(Diary d) {
		diaryDAO.editDiary(d);
	}

	public Diary findById(int id) {
		return diaryDAO.findById(id);
	}

	public List<Diary> findByUserNo(int userNo) {
		return diaryDAO.findByUserNo(userNo);
	}

	public void saveDiary(Diary d) {
		diaryDAO.saveDiary(d);
	}

	public List<Diary> findByUserNoDWR(int userNo) {
		return diaryDAO.findByUserNoDWR(userNo);
	}

	public void deleteDiary(int id, int userNo) {
		this.diaryDAO.deleteDiary(id, userNo);
		
	}

	public List<Diary> findByUserNo(int userNo, int start, int limit) {
		
		return this.diaryDAO.findByUserNo(userNo, start, limit);
	}

	public int findCountByUserNo(int userNo) {
		return this.diaryDAO.findCountByUserNo(userNo);
	}

}
